//
// Created by YE on 2024/1/5.
//

#ifndef YCH_INTERPRETER_READER_H
#define YCH_INTERPRETER_READER_H

#include "../common/ych.h"
#include "../common/ych_error.h"

#define READER_OK 0
#define READER_ERROR 1
typedef YCH_STATE State;
typedef YCH_ERROR_STATE Error_State;
typedef YCH_STATE Reader_State;
typedef YCH_STRING String;

class Reader {
public:
    Reader();
    ~Reader();
    Reader_State read_file(const char *file_path);
    char get_pre_char();
    char next_char();
    bool ready= false;
    String str;
    char ch=0;
    size_t pos=0;
    size_t line=0;
    size_t line_start_pos=0;
};

#endif //YCH_INTERPRETER_READER_H
